package info.motteke.mixivoice4j.http.json.favorite.get;

import info.motteke.mixivoice4j.Entry;
import info.motteke.mixivoice4j.http.json.JsonRequestBuilder;

public class GetFavoriteBuilder extends JsonRequestBuilder<GetFavoriteRequest> {

    private Entry entry = null;

    protected GetFavoriteBuilder () {

    }

    public GetFavoriteBuilder entry(Entry entry) {
        this.entry = entry;
        return this;
    }

    @Override
    public GetFavoriteRequest build() {
        check(entry, "entry");

        GetFavoriteRequest req = new GetFavoriteRequest();
        GetFavoriteParam p = req.getParams();
        p.setOwnerId(entry.getUser().getId());
        p.setPostTime(entry.getId());
        return req;
    }
}
